/**
 * Created by charlie on 17-12-27.
 */
import React from 'react'
import UI from '../components/taiZhang'
import {connect} from 'dva-no-router'
import {bindActionCreators} from 'redux'
import {View} from 'react-native'
import Loading from '../components/loading/loading'

class TaiZhang extends React.Component {
    componentWillMount(){
        const {getTableList}=this.props;
        getTableList();
    }
    // componentDidMount() {
    //     const {getTableList}=this.props;
    //     getTableList();
    // }
    componentWillUnmount(){
        const {getClean}=this.props;
        getClean();
    }

    render(){
        return(
            <UI  {...this.props} />
        )
    }
}

const actions ={
    getTableList:() =>({type:'taiZhang/getTableList'}),
    getDetail: (val) => ({type: 'taiZhang/getDetail',payload:val}),
    getClean:() =>({type:'taiZhang/getClean'}),
    changeText: (val) => ({type: 'taiZhang/changeText',payload:val}),
    search: () => ({type: 'taiZhang/search'}),
    selectRowData: (val) => ({type: 'taiZhang/selectRowData',payload:val}),
    setStartDate: (val) => ({type: 'taiZhang/setStartDate',payload:val}),
    setEndDate: (val) => ({type: 'taiZhang/setEndDate',payload:val}),
};
const mapProps = ({taiZhang}) =>({taiZhang});
const mapActions = dispatch =>({
    ...bindActionCreators({...actions},dispatch)
});
export default connect (mapProps,mapActions)(TaiZhang)